package com.bric.uploadFile;

import java.io.File;

import org.apache.log4j.Logger;

import com.bric.common.String_File;
import com.bric.util.StaticStr;

public class ReportFile extends Thread{
	private static final Logger log=Logger.getLogger(ReportFile.class);
	@Override
	public void run() {
		log.info("将报告文件移动的线程开始执行...");
		new ReportFile().moveReportToWebApp();
	}
	public void moveReportToWebApp(){
		
		File[] files=getReportFile();
		if(null!=files){
			for(File f:files){
				String_File.file2file(f, StaticStr.quoteWebRoot);
			}
		}
	}
	private File[] getReportFile() {
		log.info("获取报告文件的列表..");
		File[] files=null;
		File reportFile=new File(StaticStr.localFilePath+StaticStr.reportFilePath);
		if(reportFile.exists()&&reportFile.isDirectory()){
			files=reportFile.listFiles();
		}
		return files;
	}
}
